package com.layer.cms.generate;

import com.layer.cms.generate.pojo.TableClass;
import com.layer.cms.generate.service.impl.CodeGenerateTest;
import com.layer.cms.generate.util.DBUtils;

import java.util.ArrayList;
import java.util.List;

public class App {

    public static void main(String[] args) throws Exception {

        DBUtils.dataBaseName = "easychat";
        DBUtils.username = "root";
        DBUtils.password = "123qwe!@#QWE";

        CodeGenerateTest generate = new CodeGenerateTest();
        generate.generate(init(), "D:\\JavaProject\\Work\\generator\\生成代码");

        System.out.println("----->代码生成完成---------D:/home/生成代码");
    }

    /**
     * 需要生成代码的表信息(key=表名,value=表对应的模块名)
     *
     * @return
     */
    public static List<TableClass> init() {

        List<TableClass> list = new ArrayList<>();

//        list.add(TableClass.builder().tableName("user_info").modular("easychat").packageName("com.easychat").prefix(false).operationSupport("moon").build());
//        list.add(TableClass.builder().tableName("user_info_beauty").modular("easychat").packageName("com.easychat").prefix(false).operationSupport("moon").build());
        list.add(TableClass.builder().tableName("group_info").modular("easychat").packageName("com.easychat").prefix(false).operationSupport("moon").build());
        list.add(TableClass.builder().tableName("user_contact").modular("easychat").packageName("com.easychat").prefix(false).operationSupport("moon").build());
        list.add(TableClass.builder().tableName("user_contact_apply").modular("easychat").packageName("com.easychat").prefix(false).operationSupport("moon").build());

        return list;
    }
}
